$(document).ready(function() {
	try {
		if (parent != window) {
			top.location.href = location.href;
		}
	} catch (e) {
		top.location.reload();
	}
	$("#username").focus();
	$("#subBtn").click(function() {
		submitForm();
	});
	$(document).keyup(function(event) {
		if (event.keyCode == 13) {
			$("#subBtn").trigger("click");
		}
	});
	function submitForm() {
		var username = $("#username").val();
		var password = $("#password").val();
		if (username == '' || password == '') {
			$("#tip").html("<s:message code='nms.up.empty' text='用户名或密码不能为空！' />");
		}
		if (username != '' && password != '') {
			$("#ff").submit();
		}
	}
	// if(lan == "zh_CN"){
		$("#rightDiv").css("background","url("+path+"/images/login_form.png) no-repeat -379px -380px");
	// }else if(lan == "en_US"){
	// 	$("#username").css("margin-left","337px").css("width","234px").css("margin-button","5px");
	// 	$("#password").css("margin-left","337px").css("width","234px").css("margin-button","58px");
	// 	$("#rightDiv").css("background","url("+path+"/images/login_form.png) no-repeat -1318px -380px");
	// }
});

//验证码，已弃用
function next_captcha() {
	$("#captcha_img").attr("src", "captcha/next?&_=" + new Date().getTime());
}